package com.fzl.spring_chatroom.controller;

import com.fzl.spring_chatroom.model.response.MessageResponse;
import com.fzl.spring_chatroom.service.MessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private MessageService messageService;

    @GetMapping("/getMessageBySessionId")
    public List<MessageResponse> getMessageBySessionId(Integer sessionId) {
        return messageService.getMessageBySessionId(sessionId);
    }
}
